Placing a Button on a Form

Description

When you put a new button on a form, Alpha Anywhere assumes that you first want to attach a script to its OnPush event. Alpha Anywhere lets you define the action for the button in one of three ways:

  • Select a pre-defined Action

  • Use the Action Scripting Editor

  • Use the Xbasic (Code) Editor

When creating Action Scripts for button events, you can specify that the button perform a single action, like opening a Form or printing a Report, or a sequence of steps. If you want a button that performs a single task, the easiest method is to select from a list of pre-defined actions.

To create an Action for a button on a Form:

  1. If you do not see the Toolbox, select View > Toolbox.

  2. To put a button on the form, select the Button Object tool '-' on the Toolbox.

    images/Button_tool_button.gif
  3. While holding down the left mouse button, draw a small rectangle on the form.

  4. When you release the mouse button, the Define Button dialog box ( Button Genie ) appears.

    images/Define_Button_Default_Settings.gif
  5. You have two options at this point that are represented by different tabs.

    • Custom Button

    • ((|#Using_a_Predefined_Button|Pre-defined Button))

Creating a Custom Button

  1. If you choose to create a custom button, select a Style for the button. The options are:

    • "Picture followed by text"

    • "Picture only"

    • "Picture over text"

    • "Text followed by picture"

    • "Text"

    • "Text over picture"

  2. If your selection in step 1 includes a picture, click Define Picture to display the Define Picture dialog.

  3. If your selection in step 2 includes text, optionally change the button label in the Label field.

  4. If you do not want to define an action for the button:

    • 1. Clear Define script for this button now?

    • 2. Click OK.

  5. If you do want to define an action for the button, make a selection from these three options:

    • Use Action Scripting

    • Use Xbasic Editor

    • Run a Script

  6. If you selected "Run a Script":

    • 1. Choose a script from the drop-down list box.

    • 2. Click OK.

  7. Otherwise, click Next > to begin defining the action for the script.

Using a Predefined Button

The Pre-Defined Buttons tab lists the actions available in the Form menus.

  1. Select an action from the list.

  2. Optionally, change its Style. The options are:

    • "Picture followed by text"

    • "Picture only"

    • "Picture over text"

    • "Text followed by picture"

    • "Text"

    • "Text over picture"

  3. If your selection in step 2 includes a picture, click Define Picture to display the Define Picture dialog.

  4. If your selection in step 2 includes text, optionally change the button label in the Label field.

  5. Click OK to save your inputs.

Running a Saved Operation

To create a button to run a saved operation:

  1. Draw the button and define its label.

  2. Select "Use Action Scripting".

  3. Add a new action.

  4. Continue with Run Saved Operation.

  5. A sample button created in Alpha Anywhere

    images/UG_Button_Options_v8.gif

Defining Button Properties

To display the Properties dialog for a button, right click on it and select Properties... .

  1. To define the style of the button, display its Setup tab and make a selection from the Style list. The options are:

    • "Bitmap followed by text"

    • "Bitmap only"

    • "Bitmap over text"

    • "Text followed by bitmap"

    • "Text only"

    • "Text over bitmap"

  2. To define the text of the button, display its Setup tab and enter the caption into the Label control.

  3. To define the bitmap of the button, display its Setup tab, click Define button bitmaps..., and select the image from the Define Picture dialog.

  4. To define the alignment of the button label, display its Alignment tab:

    • 1. Optionally, select a Horizontal alignment

    • 2. Optionally, select a Vertical alignment.

    • 3. Optionally, disable Word wrap.

  5. To adjust the border or fill styles of a button, display the Border tab.

    • 1. To adjust the border properties of the button, refer to Defining Border Style and Color.

    • 2. To adjust the shadow properties of the button, refer to Defining Shadows.

    • 3. To adjust the fill properties of the button, refer to Defining Fill Style and Color.

  6. To define the style of the button label, display its Font tab, and select the label's font, point size, attributes, and color.

  7. To adjust the dimensions of a button, display its Dimensions tab, and set its Left and Top coordinates, and its Width and Height. You may change the units of measure on the dialog.

See Also